package demo2;
import java.util.Arrays;
import java.util.Random;
public class Test {

    public static void quickSortSpeed(int[] array){
        Sort sort = new Sort();
        int[] arrayTest = Arrays.copyOf(array,array.length);
        long startTime = System.currentTimeMillis();
        sort.quickSort(array);
        long endTime = System.currentTimeMillis();
        System.out.println("快速排序用时："+(endTime - startTime));
    }
    public static void insertSortSpeed(int[] array){
        Sort sort = new Sort();
        int[] arrayTest = Arrays.copyOf(array,array.length);
        long startTime = System.currentTimeMillis();
        sort.shellSort2(array);
        long endTime = System.currentTimeMillis();
        System.out.println("希尔排序用时："+(endTime - startTime));
    }

    public static void main(String[] args){
        Sort sort = new Sort();
        Random random = new Random();/*
        int[] array = new int[1000_0000];

        for(int i = 0; i < array.length; i++){
            array[i] = random.nextInt(array.length);
        }
        insertSortSpeed(array);
        quickSortSpeed(array);*/
        System.out.println("===========================");
        /*int[] array = new int[10];
        for(int i = 0; i < array.length; i++){
            array[i] = random.nextInt(array.length+10);
        }*/
        int[] array = {3,3,1,0,1,2,8,8,1,7,9};
        sort.countSort(array);
        System.out.println(Arrays.toString(array));
    }
}
